#include<iostream>
#include<iomanip>
using namespace std;

double f(double x,double y)
{double result=1;
 for(int i=1;i<=y;i++)
   result*=x;
 //cout<<result<<endl;
 return result;
}

int main()
{int N,a,b,c,d,a1[1000],b1[1000],c1[1000],d1[1000], h=1;
 cin>>N;
 
  for(int i=1;i<=a;i++)
    {  
      for(int j=1;j<=b;j++)
       {
         for(int k=1;k<=c;k++)
          {
            for(int l=1;l<=d;l++)
               {if(f(i,N)==f(j,N)+f(k,N)+f(l,N)) {a1[h]=i;b1[h]=j;c1[h]=k;d1[h]=l;h++;}    }
           
           }    
         }
    }
             
 for(int e=1;e<=h-1;e++)
    cout<<"Cube = "<<a1[e]<<", Triple = ("<<b1[e]<<","<<c1[e]<<","<<d1[e]<<")"<<endl; 
system("pause");
return 0;
}
   
